import Login from "../views/Login"
import NotFound from "../views/NotFound"
import Main from "../components/Main/index.jsx"

import CfyList from "../views/Cfy/CfyList"
import CfyPublish from "../views/Cfy/CfyPublish"
import JobList from "../views/Cfy/JobList"
import JobPublish from "../views/Cfy/JobPublish"
import Setting from "../views/Setting"
import DashBoard from "../views/DashBoard"

import {
  AuditOutlined,
  BranchesOutlined,
  BarsOutlined,
  ProfileOutlined
} from '@ant-design/icons';

// 第一层路由映射数据包
const mainRoutes=[
  {
    path:"/login",
    component:Login
  },
  {
    path:"/404",
    component:NotFound
  },
  {
    path:"/admin",
    component: Main
  }
]

// 第二次路由映射数据包
const adminRoutes=[
  {
    path: '/admin',
    component: DashBoard,
    title: '平台首页',
    icon: < ProfileOutlined / > ,
    roles: ['root', 'manage', 'worker'],
    exact:true,
  },
  {
    title:'分类管理',
    roles:['root','manage'],
    children:[
      {
        path: "/admin/cfy/pub",
        component: CfyPublish,
        title: '发布分类',
        icon: <AuditOutlined/>,
        roles:['root']
      },
      {
        path: "/admin/cfy/list",
        component: CfyList,
        title: '分类列表',
        icon: <BranchesOutlined/>,
        roles:['root','manage']
      },
    ]
  },
  {
    title:'岗位管理',
    roles:['root','manage','worker'],
    children:[
       {
         path: "/admin/job/pub",
         component: JobPublish,
         title: '岗位分类',
         icon: <BarsOutlined/> ,
         roles:['root','worker']
       },
       {
         path: "/admin/job/list",
         component: JobList,
         title: '岗位列表',
         icon: <ProfileOutlined/>,
         roles:['root','manage']
       },
       {
         path:"/admin/404",
         component:NotFound,
         roles:['root','manage','worker']
       }
    ]
  },
  { 
    path:'/setting',
    component:Setting,
    title:'个人设置',
    icon: <ProfileOutlined/>,
    roles: ['root', 'manage','worker']
  }
]

export {mainRoutes,adminRoutes}